:root {
    --theme-color: #e7ae97;
    --bar-accent: #667eea;
    --font-size-base: 12px;
    --bg-opacity: 0.9; /* 可动态调整的透明度 */
    --bg-color: rgba(0, 0, 0, calc(var(--bg-opacity) * 0.85));
    --panel-color: rgba(255, 255, 255, calc(var(--bg-opacity) * 0.15));
    --text-color: #ffffff;
    --player-item-height: 78px; /* 默认玩家条高度（较之前略增） */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    user-select: none;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: var(--font-size-base);
}

.title-bar {
    background: var(--theme-color);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    -webkit-app-region: drag;
    border-radius: 8px 8px 0 0;
}

.title {
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.controls {
    display: flex;
    gap: 4px;
    -webkit-app-region: no-drag;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: white;
    font-size: 12px;
    transition: background-color 0.2s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.control-btn.close:hover {
    background: rgba(255, 0, 0, 0.7);
}

.control-btn.locked {
    background: var(--theme-color);
    color: white;
}

.content {
    padding: 12px;
    height: calc(100vh - 40px);
    overflow-y: auto;
}

/* 总览柱状图 */
.overview-panel { background: var(--panel-color); border-radius: 6px; padding: 6px 10px; margin-bottom: 6px; height: auto; display: flex; flex-direction: column; justify-content: center; }
.overview-title { font-weight: bold; margin-bottom: 6px; color: #ecf0f1; }
.overview-row { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 8px; margin: 2px 0; }
.overview-label { color: #bdc3c7; font-size: 11px; }
.overview-bar { height: 8px; background: rgba(255,255,255,.15); border-radius: 4px; overflow: hidden; }
.overview-fill { height: 100%; width: 0; transition: width .3s ease; border-radius: 4px; }
.overview-fill.damage { background: linear-gradient(90deg,#e74c3c,#f39c12); }
.overview-fill.healing { background: linear-gradient(90deg,#2ecc71,#1abc9c); }
.overview-fill.taken { background: linear-gradient(90deg,#95a5a6,#7f8c8d); }
.overview-value { min-width: 56px; text-align: right; font-weight: bold; }

.damage-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.loading {
    text-align: center;
    color: #ccc;
    padding: 20px;
    font-size: 14px;
}

.damage-item {
    background: var(--panel-color);
    border-radius: 6px;
    padding: 2px 6px;
    border-left: 3px solid var(--bar-accent);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    margin-bottom: 2px;
    min-height: var(--player-item-height);
    height: auto; /* 改为auto，允许内容撑开高度 */
    overflow: visible; /* 允许技能浮层溢出显示，不顶下其他条目 */
}

/* 紧凑模式下仍使用更低高度，保证可视数量 */
body.compact-mode .damage-item {
    min-height: 65px;
    height: auto; /* 紧凑模式下也允许自动撑开 */
}

.damage-item:hover {
    background: rgba(255, 255, 255, calc(var(--bg-opacity) * 0.18));
    transform: translateX(2px);
}

.damage-item.rank-1 {
    border-left-color: #ffce54;
    background: linear-gradient(135deg, rgba(255, 206, 84, calc(var(--bg-opacity) * 0.35)) 0%, rgba(255, 255, 255, calc(var(--bg-opacity) * 0.12)) 100%);
}

.damage-item.rank-2 {
    border-left-color: #c0392b;
    background: linear-gradient(135deg, rgba(192, 57, 43, calc(var(--bg-opacity) * 0.25)) 0%, rgba(255, 255, 255, calc(var(--bg-opacity) * 0.12)) 100%);
}

.damage-item.rank-3 {
    border-left-color: #8e44ad;
    background: linear-gradient(135deg, rgba(142, 68, 173, calc(var(--bg-opacity) * 0.25)) 0%, rgba(255, 255, 255, calc(var(--bg-opacity) * 0.12)) 100%);
}

.player-info {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    line-height: 1.2;
}

.player-info.compact {
    margin-bottom: 0;
}

.player-name {
    font-weight: bold;
    font-size: calc(var(--font-size-base) + 1px);
    color: #ecf0f1;
    line-height: 1.1;
}

.player-profession {
    font-size: var(--font-size-base);
    color: #95a5a6;
    font-style: italic;
    margin-top: 2px;
}

.rank-badge {
    background: rgba(255, 255, 255, calc(var(--bg-opacity) * 0.25));
    padding: 1px 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.rank-1 .rank-badge {
    background: #ffce54;
    color: #2c3e50;
}

.rank-2 .rank-badge {
    background: #c0392b;
    color: white;
}

.rank-3 .rank-badge {
    background: #8e44ad;
    color: white;
}

.damage-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.stat-label {
    color: #bdc3c7;
}

.stat-value {
    color: #ecf0f1;
    font-weight: bold;
}

/* 主要统计数据样式 */
.stat-row.main-stat {
    font-size: 14px;
    font-weight: bold;
}

.stat-row.main-stat .stat-label {
    color: #f39c12;
}

.stat-row.main-stat .stat-value {
    color: #ecf0f1;
    font-size: 15px;
}

/* 次要统计数据样式 */
.stat-row.secondary {
    font-size: 12px;
    opacity: 0.8;
}

.stat-row.secondary .stat-label {
    color: #95a5a6;
}

.stat-row.secondary .stat-value {
    color: #bdc3c7;
}

/* 治疗数据样式 */
.stat-row.healing .stat-label {
    color: #2ecc71;
}

.healing-value {
    color: #2ecc71 !important;
}

/* 承受伤害样式 */
.stat-row.taken .stat-label {
    color: #e74c3c;
}

.taken-value {
    color: #e74c3c !important;
}

.percentage-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

/* 统计芯片行，保证横向紧凑不换行，避免布局错乱 */
.stat-chips { display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: nowrap; }
.chip { padding: 1px 6px; border-radius: 10px; font-size: 11px; line-height: 16px; background: rgba(255,255,255,calc(var(--bg-opacity) * 0.1)); border: 1px solid rgba(255,255,255,calc(var(--bg-opacity) * 0.18)); color: #ecf0f1; white-space: nowrap; }
.chip.damage { border-color: #e67e22; color: #f39c12; }
.chip.healing { border-color: #27ae60; color: #2ecc71; }
.chip.taken { border-color: #7f8c8d; color: #bdc3c7; }

/* 迷你条三项（治疗/承伤） */
.mini-bars { display: flex; gap: 8px; margin-top: 2px; align-items: center; }
.mini { display: flex; align-items: center; gap: 4px; }
.mini-label { font-size: 10px; color: #bdc3c7; min-width: 18px; }
.mini-percent { font-size: 10px; color: #ecf0f1; min-width: 26px; text-align: right; }
.mini-bar { width: 80px; height: 3px; background: rgba(255,255,255,calc(var(--bg-opacity) * 0.25)); border-radius: 2px; overflow: hidden; }
.mini-bar .fill { height: 100%; border-radius: 2px; width: 0; transition: width .3s ease; }
.mini-bar .fill.heal { background: #2ecc71; }
.mini-bar .fill.taken { background: #e74c3c; }

.percentage-fill {
    height: 100%;
    background: var(--theme-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 紧凑模式样式 */
.damage-stats.compact {
    display: none;
}

.damage-item.expanded .damage-stats.compact {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 技能详情采用文档流展开：会把下面玩家条顶下去（符合需求） */
.skill-details {
    margin-top: 8px;
    border: 1px solid rgba(255, 206, 84, calc(var(--bg-opacity) * 0.4));
    border-radius: 6px;
    background: rgba(0, 0, 0, calc(var(--bg-opacity) * 0.4));
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease;
}

.damage-item.expanded .skill-details {
    max-height: 520px; /* 更大展开高度，避免内容溢出重叠 */
    overflow-y: auto;
}

/* 技能详情布局 - 固定列宽对齐 */
.skill-line { 
    display: grid; 
    grid-template-columns: 1fr 90px 60px 60px; 
    align-items: center; 
    gap: 8px; 
    margin-bottom: 4px;
    width: 100%;
}

.skill-col-name {
    font-size: 12px;
    color: #ecf0f1;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.skill-col-damage, .skill-col-count, .skill-col-percentage { 
    text-align: right; 
    font-weight: bold; 
    font-size: 11px; 
    white-space: nowrap;
}

.skill-col-damage { color: #e74c3c; }
.skill-col-count { color: #95a5a6; }
.skill-col-percentage { color: #f39c12; }

.skill-bar-row { 
    height: 6px; 
    background: rgba(255,255,255, calc(var(--bg-opacity) * 0.12)); 
    border-radius: 3px; 
    overflow: hidden; 
    position: relative;
    margin-top: 4px;
    width: 100%;
    display: block;
}

.skill-bar-fill { 
    height: 100%; 
    background: linear-gradient(90deg, #e74c3c, #f39c12); 
    border-radius: 3px; 
    transition: width 0.3s ease; 
}

/* 技能项容器 - 支持网格布局和柱状图 */
.skill-item {
    display: block; /* 改为block以支持内部网格布局 */
    background: rgba(255, 255, 255, calc(var(--bg-opacity) * 0.08));
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
    border-left: 3px solid #e74c3c;
    transition: all 0.3s ease;
}

.skill-item:hover {
    background: rgba(255, 255, 255, calc(var(--bg-opacity) * 0.12));
}

.skill-item:last-child {
    margin-bottom: 0;
}

.skill-name {
    color: #ecf0f1;
    flex: 1;
    margin-right: 8px;
}

.skill-stats {
    display: flex;
    gap: 8px;
    font-size: 10px;
}

.skill-damage {
    color: #3498db;
}

.skill-count {
    color: #95a5a6;
}

.skill-percentage {
    color: #e7ae97;
}

/* 技能详情页面样式 */
.main-view, .skill-view {
    width: 100%;
    height: 100%;
}

.skill-view {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--bg-color);
    z-index: 100;
}

.skill-view.hidden {
    display: none;
}

.skill-header {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(231, 174, 151, 0.1);
}

.back-btn {
    background: var(--theme-color);
    border: none;
    border-radius: 6px;
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #d4987a;
    transform: translateX(-2px);
}

.skill-player-info {
    flex: 1;
}

.player-name-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.skill-player-name {
    font-size: 16px;
    font-weight: bold;
    color: #ecf0f1;
}

.edit-nickname-btn {
    background: rgba(255, 206, 84, 0.2);
    border: 1px solid #ffce54;
    color: #ffce54;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.edit-nickname-btn:hover {
    background: rgba(255, 206, 84, 0.4);
    transform: scale(1.1);
}

.skill-player-profession {
    font-size: 12px;
    color: #95a5a6;
    font-style: italic;
}

.skill-details-list {
    padding: 12px;
    height: calc(100% - 60px);
    overflow-y: auto;
}

.skill-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border-left: 4px solid #e7ae97;
}

.skill-summary-title {
    font-size: 14px;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 8px;
}

.skill-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.skill-summary-item {
    text-align: center;
}

.skill-summary-label {
    font-size: 10px;
    color: #95a5a6;
    display: block;
}

.skill-summary-value {
    font-size: 14px;
    font-weight: bold;
    color: #ecf0f1;
    display: block;
}

.skill-list-title {
    font-size: 14px;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 8px;
    padding-left: 4px;
}

.skill-item-detail {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 6px;
    border-left: 3px solid var(--bar-accent);
    transition: all 0.2s;
}

.skill-item-detail:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.skill-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.skill-item-name {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 13px;
}

.skill-item-percentage {
    background: var(--theme-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.skill-item-stats {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.skill-stat-group {
    display: flex;
    gap: 12px;
}

.skill-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skill-stat-label {
    color: #95a5a6;
    font-size: 9px;
}

.skill-stat-value {
    color: #ecf0f1;
    font-weight: bold;
}

.rank-1 .percentage-fill {
    background: linear-gradient(90deg, #ffce54, #ff9500);
}

.rank-2 .percentage-fill {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.rank-3 .percentage-fill {
    background: linear-gradient(90deg, #8e44ad, #9b59b6);
}

/* 设置面板样式 */
.settings-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    border-radius: 8px;
    z-index: 1000;
    overflow-y: auto;
}

.settings-panel.hidden {
    display: none;
}

.settings-header {
    background: var(--theme-color);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.settings-header h3 {
    color: white;
    font-size: 16px;
    margin: 0;
}

.close-settings {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: white;
    font-size: 14px;
}

.close-settings:hover {
    background: rgba(255, 0, 0, 0.7);
}

.settings-content {
    padding: 16px;
}

.setting-group {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-group label {
    min-width: 65px;
    color: #bdc3c7;
    font-size: 14px;
}

.setting-group input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

.setting-group input[type="number"],
.setting-group select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 8px;
    color: #ecf0f1;
    font-size: 14px;
    width: 80px;
}

.setting-group select option {
    background: rgba(44, 62, 80, 0.95);
    color: #ecf0f1;
    border: none;
}

.setting-group input[type="number"]:focus,
.setting-group select:focus {
    outline: none;
    border-color: var(--theme-color);
    box-shadow: 0 0 0 2px rgba(231, 174, 151, 0.3);
}

.setting-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.reset-btn {
    background: var(--theme-color);
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

.reset-btn:hover {
    opacity: 0.8;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 计时器面板样式 */
.timer-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    border-radius: 8px;
    z-index: 1100;
    overflow-y: auto;
}

.timer-panel.hidden {
    display: none;
}

.timer-header {
    background: var(--theme-color);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.timer-header h3 {
    color: white;
    font-size: 16px;
    margin: 0;
}

.close-timer {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: white;
    font-size: 14px;
}

.close-timer:hover {
    background: rgba(255, 0, 0, 0.7);
}

.timer-content {
    padding: 16px;
}

.timer-status {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.timer-display {
    font-size: 32px;
    font-weight: bold;
    color: #4fc3f7;
    margin-bottom: 8px;
}

.timer-mode {
    font-size: 16px;
    color: #bdc3c7;
}

.timer-controls {
    margin-bottom: 20px;
}

.timer-presets {
    margin-bottom: 16px;
}

.timer-presets h4,
.timer-custom h4 {
    color: #ecf0f1;
    font-size: 14px;
    margin-bottom: 8px;
}

.timer-preset {
    background: var(--theme-color);
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    transition: opacity 0.2s;
}

.timer-preset:hover {
    opacity: 0.8;
}

.timer-custom {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.timer-custom input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 8px;
    color: white;
    font-size: 14px;
    width: 80px;
}

.timer-custom button {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.timer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timer-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
}

.timer-btn.start {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.timer-btn.stop {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.timer-btn.reset {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.timer-btn.exit {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.timer-btn:hover:not(:disabled) {
    opacity: 0.8;
    transform: translateY(-2px);
}

.timer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.timer-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #bdc3c7;
    font-size: 14px;
}

.info-value {
    color: #ecf0f1;
    font-weight: bold;
    font-size: 14px;
}

/* 计时器动画效果 */
.timer-display.counting {
    animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        color: #4fc3f7;
    }
    to {
        color: #ff9800;
    }
}

.timer-display.finished {
    color: #e74c3c;
    animation: flash 0.5s ease-in-out infinite;
}

@keyframes flash {
    from {
        opacity: 1;
    }
    to {
        opacity: 0.5;
    }
}

/* 下拉菜单样式 */
.control-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    position: relative;
}

.dropdown-btn::after {
    content: "";
    font-size: 8px;
    margin-left: 4px;
    opacity: 0.7;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 10px;
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-section {
    margin-bottom: 8px;
}

.dropdown-section:last-child {
    margin-bottom: 0;
}

.dropdown-header {
    color: #ecf0f1;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.dropdown-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-option input[type="radio"],
.dropdown-option input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #e7ae97;
}

.dropdown-option span {
    user-select: none;
    flex: 1;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* 响应式设计 - 标题栏控件隐藏 */
@media (max-width: 500px) {
    /* 宽度小于500px时隐藏可折叠控件，只保留必要的锁定和关闭 */
    .control-btn.collapsible,
    .control-dropdown.collapsible {
        display: none;
    }
    
    .controls {
        gap: 6px;
    }
    
    .title {
        font-size: 13px;
    }
    
    /* 必要控件在小屏下优化显示 */
    .control-btn.essential {
        padding: 4px 6px;
        font-size: 11px;
    }
}

@media (max-width: 400px) {
    /* 宽度更小时进一步优化 */
    .title {
        font-size: 12px;
    }
    
    .control-btn {
        padding: 3px 6px;
        font-size: 11px;
    }
}

@media (max-width: 350px) {
    .player-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .stat-row {
        font-size: 12px;
    }
    
    .timer-custom {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timer-actions {
        gap: 6px;
    }
    
    .timer-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 12px;
    border: 2px solid #ffce54;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 206, 84, 0.3);
}

.modal-header h3 {
    margin: 0;
    color: #ffce54;
    font-size: 16px;
}

.close-modal {
    background: transparent;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.modal-body {
    padding: 20px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    color: #ecf0f1;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #555;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    font-size: 14px;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #ffce54;
    box-shadow: 0 0 0 2px rgba(255, 206, 84, 0.2);
}

.player-uid-info {
    color: #95a5a6;
    font-size: 12px;
    margin-top: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 206, 84, 0.3);
}

.save-btn, .cancel-btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
}

.save-btn {
    background: #27ae60;
    color: white;
}

.save-btn:hover {
    background: #2ecc71;
    transform: translateY(-1px);
}

.cancel-btn {
    background: #7f8c8d;
    color: white;
}

.cancel-btn:hover {
    background: #95a5a6;
    transform: translateY(-1px);
}

/* 昵称管理样式 */
.nickname-manager {
    max-width: 720px;
    width: 96%;
    background: var(--panel-color);
}

.nickname-search {
    margin-bottom: 16px;
}

.nickname-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #555;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
    font-size: 14px;
    box-sizing: border-box;
}

.nickname-search input:focus {
    outline: none;
    border-color: #ffce54;
    box-shadow: 0 0 0 2px rgba(255, 206, 84, 0.2);
}

.nickname-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 206, 84, 0.3);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 16px;
}

.nicknames-list {
    padding: 8px;
}

.nickname-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--panel-color);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.nickname-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nickname-info {
    flex: 1;
}

.nickname-uid {
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 4px;
}

.nickname-name {
    font-size: 14px;
    color: #ecf0f1;
    font-weight: bold;
}

.nickname-actions-item {
    display: flex;
    gap: 8px;
}

.edit-nickname-item, .delete-nickname-item {
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    border: none;
    transition: all 0.3s ease;
}

.edit-nickname-item {
    background: #3498db;
    color: white;
}

.edit-nickname-item:hover {
    background: #2980b9;
}

.delete-nickname-item {
    background: #e74c3c;
    color: white;
}

.delete-nickname-item:hover {
    background: #c0392b;
}

.nickname-actions {
    display: flex;
    gap: 12px;
}

.add-btn, .refresh-btn, .manage-btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    transition: all 0.3s ease;
}

.manage-btn {
    background: #9b59b6;
    color: white;
    width: 100%;
}

.manage-btn:hover {
    background: #8e44ad;
    transform: translateY(-1px);
}

.add-btn {
    background: #27ae60;
    color: white;
    flex: 1;
}

.add-btn:hover {
    background: #2ecc71;
}

.refresh-btn {
    background: #3498db;
    color: white;
}

.refresh-btn:hover {
    background: #2980b9;
}

/* 技能查看按钮样式 */
/* 移除技能按钮相关样式（改为点击玩家条） */
.skill-actions { display:none; }
.skill-btn { display:none; }

/* 技能详情展开样式 */
.skill-details {
    margin-top: 8px;
    border: 1px solid rgba(255, 206, 84, 0.3);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.skill-details-content {
    padding: 12px;
}

.skill-header {
    font-size: 14px;
    font-weight: bold;
    color: #ffce54;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 重复的skill-item样式已移除，使用上面统一的定义 */

.skill-name {
    font-size: 12px;
    color: #ecf0f1;
    font-weight: bold;
    margin-bottom: 4px;
}

.skill-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.skill-damage {
    font-size: 11px;
    color: #e74c3c;
    font-weight: bold;
}

.skill-percentage {
    font-size: 11px;
    color: #f39c12;
    font-weight: bold;
}

.skill-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.skill-fill { height: 100%; background: linear-gradient(90deg, #e74c3c, #f39c12); border-radius: 2px; transition: width 0.3s ease; }

.skill-loading {
    text-align: center;
    padding: 16px;
    color: #95a5a6;
    font-size: 12px;
}

.skill-error {
    text-align: center;
    padding: 16px;
    color: #e74c3c;
    font-size: 12px;
}

.skill-empty {
    text-align: center;
    padding: 16px;
    color: #95a5a6;
    font-size: 12px;
}

@keyframes fadeIn {
    from { opacity: 0; height: 0; }
    to { opacity: 1; height: auto; }
}
